﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CERT.Services.DAL
{
    #pragma warning disable 1573
    
       
        using System;
        using System.Data.Common;
        using System.Data.Entity;
        using System.Data.Entity.Infrastructure;
        using System.Data.SqlClient;

        public partial class NETEntities : DbContext, INETEntities
        {

//            using (SqlConnection sqlConnection = new SqlConnection(connectionString))

//using (EntityConnection entityConnection = new EntityConnection(workspace, sqlConnection))


            static NETEntities()
            {
                Database.SetInitializer<NETEntities>(null);
            }

            public NETEntities()
                : base("name=NETEntities")
            {
                
                this.Configuration.ProxyCreationEnabled = false;
                this.Configuration.LazyLoadingEnabled = false;
            }

           
            public NETEntities(string nameOrConnectionString)
                : base(nameOrConnectionString)
            {
                this.Configuration.ProxyCreationEnabled = false;
                this.Configuration.LazyLoadingEnabled = false;
            }

            public NETEntities(string nameOrConnectionString, DbCompiledModel model)
                : base(nameOrConnectionString, model)
            {
            }

            public NETEntities(DbConnection existingConnection, bool contextOwnsConnection)
                : base(existingConnection, contextOwnsConnection)
            {
            }

            public NETEntities(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection)
                : base(existingConnection, model, contextOwnsConnection)
            {
            }
            protected override void OnModelCreating(DbModelBuilder modelBuilder)
            {
                modelBuilder.Configurations.Add(new Incident_Mapping());
                modelBuilder.Configurations.Add(new Location_Mapping());
                modelBuilder.Configurations.Add(new LocationHazard_Mapping());
                modelBuilder.Configurations.Add(new Victim_Mapping());
                modelBuilder.Configurations.Add(new Lookup_Mapping());
                modelBuilder.Configurations.Add(new LookupType_Mapping());
                modelBuilder.Configurations.Add(new People_TeamMember_Mapping());
                
                modelBuilder.Configurations.Add(new Person_Mapping());
                modelBuilder.Configurations.Add(new Team_Mapping());
                modelBuilder.Configurations.Add(new TeamRolesForLocation_Mapping());
                modelBuilder.Configurations.Add(new UserProfile_Mapping());
                modelBuilder.Configurations.Add(new webpages_Membership_Mapping());
                modelBuilder.Configurations.Add(new webpages_OAuthMembership_Mapping());
                modelBuilder.Configurations.Add(new webpages_Roles_Mapping());
                modelBuilder.Configurations.Add(new webpages_UsersInRoles_Mapping());
            }

            public IDbSet<Incident> Incidents { get; set; }
            public IDbSet<LocationHazard> LocationHazards { get; set; }
            public IDbSet<Location> Locations { get; set; }
            public IDbSet<Victim> Victims { get; set; }
            public IDbSet<Lookup> Lookups { get; set; }
            public IDbSet<LookupType> LookupTypes { get; set; }
            public IDbSet<Person> People { get; set; }
            public IDbSet<People_TeamMember> People_TeamMember { get; set; }
            public IDbSet<TeamRolesForLocation> TeamRolesForLocations { get; set; }
            public IDbSet<Team> Teams { get; set; }
            public IDbSet<UserProfile> UserProfiles { get; set; }
            public IDbSet<webpages_Membership> webpages_Membership { get; set; }
            public IDbSet<webpages_OAuthMembership> webpages_OAuthMembership { get; set; }
            public IDbSet<webpages_Roles> webpages_Roles { get; set; }
            public IDbSet<webpages_UsersInRoles> webpages_UsersInRoles { get; set; }


                 }
    

}